import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import DashboardViewVue from '../components/DashboardView.vue'
import profile from '../components/ProfileView.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      meta: {
        requireAuth: true
      },
      children: [
        {
          path: '/',
          name: 'dashboard',
          component:DashboardViewVue
        },
        {
          path: '/profile',
          name: 'profile',
          component:profile
        }
      ]
    },
    {
      path: '/about',
      name: 'about',
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/:pathMatch(.*)*',
      name: 'not-found',
      component: () => import('../components/not-found/NotFoundView.vue')
    }
  ]
})

export default router
